import Vue from 'vue'
import App from './App.vue'
import EUpload from './components/EUpload/EUpload.vue'
import { useAntd } from 'k-form-design/packages/core/useComponents'
import KFormDesign from 'k-form-design/packages/use.js'
import 'k-form-design/lib/k-form-design.css'
import { nodeSchema } from 'k-form-design'
// 只是示例，没做按需加载
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

// 使用函数配置
// 添加组件
nodeSchema.addSchemas([
  {
    type: "demo", // 表单类型
    label: "el上传组件", // 标题文字
    icon: "icon-gallery",
    component: EUpload,
    options: {
      defaultValue: undefined,
      multiple: false,
      disabled: false,
      width: "100%",
      clearable: true,
      placeholder: "请选择",
      showSearch: false,
      showLabel: true
    },
    model: "",
    key: "",
    rules: [
      {
        required: false,
        message: "必填项"
      }
    ]
  }
]);

// 添加分组
nodeSchema.addSchemaGroup({
  title: "自定义组件",
  list: ["demo"]
});
useAntd(Vue)
Vue.use(KFormDesign)

Vue.config.productionTip = false
new Vue({
  render: h => h(App),
}).$mount('#app')
